package tt.com.feesmanager.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import tt.com.common.enums.Status;
import tt.com.common.enums.TollEnum;
import tt.com.common.model.DeadProject;
import tt.com.common.util.CommonResult;
import tt.com.feesmanager.mapper.DeadprojectMapper;
import tt.com.feesmanager.service.FeeSettlementService;

@Service
public class FeeSettlementServiceImpl extends ServiceImpl<DeadprojectMapper, DeadProject> implements FeeSettlementService {
    @Override
    public CommonResult FeeSettlement(DeadProject deadProject) {
        if (deadProject==null){
            return CommonResult.buildR(Status.DEFAULT,"不存在该服务项目，操作失败");
        }else if (deadProject.getFruitCost()!=null){
            //如果匹配到项目，并且实际收款不为空，就修改状态为缴费成功
            deadProject.setChargeableStatus(TollEnum.PAYMENT_WAS_SUCCESSFUL);
            return CommonResult.buildR(Status.OK,"操作成功");
        }else
            return CommonResult.buildR(Status.OK,"操作失败");
    }
}
